import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'tlc_lock_method_channel.dart';

class ScanResult {
  final String? name;
  final String identifier;
  // final Map<String, dynamic> ad;

  ScanResult({required this.name, required this.identifier});
}

abstract class TlcLockPlatform extends PlatformInterface {
  /// Constructs a TlcLockPlatform.
  TlcLockPlatform() : super(token: _token);

  static final Object _token = Object();

  static TlcLockPlatform _instance = MethodChannelTlcLock();

  /// The default instance of [TlcLockPlatform] to use.
  ///
  /// Defaults to [MethodChannelTlcLock].
  static TlcLockPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [TlcLockPlatform] when
  /// they register themselves.
  static set instance(TlcLockPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  Future<String?> test() {
    throw UnimplementedError("test has not been implemented.");
  }

  /// Checks whether the hardware supports Bluetooth
  Future<bool> get isSupported {
    throw UnimplementedError("isSupported has not been implemented.");
  }

  Stream<ScanResult> scan(List<String> services,
      {bool allowDuplicationKeys = false}) {
    throw UnimplementedError("scan has not been implemented.");
  }

  Future<void> connect(String identifier) {
    throw UnimplementedError("connect has not been implemented.");
  }
}
